<!-- 成绩汇总页面 -->
<template>
    <el-container style="border: 1px solid #eee">
        <el-container>
            <el-table :data="evalResultList" border style="width: 100%">
                <el-table-column prop="cardId" label="学号"></el-table-column>
                <el-table-column prop="evalStatus" label="审核状态"></el-table-column>
                <el-table-column prop="gpaScore" label="GPA得分"></el-table-column>
                <el-table-column prop="occupScore" label="学生骨干岗位得分" width="150px"></el-table-column>
                <el-table-column prop="practiceScore" label="社会实践得分"></el-table-column>
                <el-table-column prop="reportScore" label="个人报告得分"></el-table-column>
                <el-table-column prop="researchScore" label="科研成果得分"></el-table-column>
                <el-table-column prop="volunScore" label="志愿服务得分"></el-table-column>
                <el-table-column prop="awardScore" label="竞赛获奖得分"></el-table-column>
                <el-table-column prop="totalScore" label="综合得分"></el-table-column>
            </el-table>
        </el-container>
    </el-container>
</template>

<script>
import { getEvalResultListApi } from '@/wangdy55/api'

export default {
    data() {
        return {
            evalResultList: [],
            dialogTableVisible: false,
            sumTableVisible: false,
            tableData: [],
            fileList: [],
        }
    },
    created() {
        this.getEvalResultList('国家奖学金', '2022-2023')
    },
    methods: {
        getEvalResultList(scholarship, acYear) {
            getEvalResultListApi(scholarship, acYear).then(res => {
                this.evalResultList = res.data.data
                this.evalResultList.forEach(evalResult => {
                    evalResult.totalScore = (evalResult.gpaScore + evalResult.occupScore + evalResult.practiceScore + evalResult.reportScore + evalResult.researchScore + evalResult.volunScore + evalResult.awardScore) / 7
                    evalResult.totalScore = evalResult.totalScore.toFixed(2)
                })
            })
        },
        exportTable() {
            // 下载所有文件
            // ...
        },
        resetDateFilter() {
            this.$refs.filterTable.clearFilter('date');
        },
        clearFilter() {
            this.$refs.filterTable.clearFilter();
        },
        // eslint-disable-next-line no-unused-vars
        formatter(row, column) {
            return row.address;
        },
        filterTag(value, row) {
            return row.tag === value;
        },
        filterHandler(value, row, column) {
            const property = column['property'];
            return row[property] === value;
        },
    }
};
</script>

<style scoped lang="scss">
.el-header {
    background-color: #B3C0D1;
    color: #333;
    line-height: 60px;
}

.el-aside {
    color: #333;
}
.el-dialog {
    width: 90vw;
}
.el-dropdown{
    margin-left: 1em;
}
</style>

